# Maintainer:
pkgname=libtraceevent
pkgver=1.8.2
pkgrel=0
pkgdesc="Linux kernel trace event library"
url="https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git"
arch="all"
license="LGPL-2.1-or-later AND GPL-2.0-or-later"
depends_dev="linux-headers"
makedepends="
	$depends_dev
	asciidoc
	meson
	xmlto
	"
checkdepends="cunit-dev"
subpackages="$pkgname-plugins $pkgname-dev"
source="https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/snapshot/libtraceevent-$pkgver.tar.gz"

build() {
	abuild-meson \
		--default-library=shared \
		-Db_lto=true \
		. output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

plugins() {
	pkgdesc="$pkgdesc (plugins)"
	# it had the same plugin files
	replaces="perf<6.2"

	amove usr/lib/libtraceevent/plugins
}

sha512sums="
52b7a23e8bf04feaa568199c99c98217fcb8df1b99d46197ef9edcea19b42e71ff9d2e6c45ebf5335ec782d636ad3d14be4acae5a9e5158650f5f62813081fa2  libtraceevent-1.8.2.tar.gz
"
